package com.gjy.scheduling.monitor.processor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-08-11 14:20:07
 */
@Component
public class SimpleScheduleConfigure implements SchedulingConfigurer {

    private static final Logger log = LoggerFactory.getLogger(SimpleScheduleConfigure.class);

    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        log.info("a: {}", taskRegistrar);
        taskRegistrar.addFixedDelayTask(() -> {
            log.info("time: {}", LocalDateTime.now());
        }, 5000);
    }

}
